package com.baidu.mpks.role.domain;

import com.baidu.mpks.permission.domain.Permission;
import com.baidu.mpks.permission.domain.PermissionDataRole;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class Role implements Serializable {

    private Integer id;
    private String roleName;
    private String description;
    private List<Permission> permissionList;
    private List<PermissionDataRole> treePermissionList;
    private List<PermissionDataRole> typePermissionList;
    private String status;
    private Integer edit;
    private Integer delete;
    private String createBy;
    private String updateBy;
    private String deleteBy;
    private String deleteFlag;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date createTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date updateTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date deleteTime;

    public Role(String createBy, String updateBy) {
        this.setCreateBy(createBy);
        this.setUpdateBy(updateBy);
    }
}
